home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat3 / Tk / crtselhdlr.z / crtselhdlr
Encoding:
Text File  |  2002-10-03  |  9.1 KB  |  199 lines

  1.  
  2.  
  3.  
  4. TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))                              TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tk_CreateSelHandler, Tk_DeleteSelHandler - arrange to handle requests for
  10.      a selection
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
  14.  
  15.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr(_t_k_w_i_n, _s_e_l_e_c_t_i_o_n, _t_a_r_g_e_t, _p_r_o_c, _c_l_i_e_n_t_D_a_t_a, _f_o_r_m_a_t)  |
  16.  
  17.      TTTTkkkk____DDDDeeeelllleeeetttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr(_t_k_w_i_n, _s_e_l_e_c_t_i_o_n, _t_a_r_g_e_t)                            |
  18.  
  19. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  20.      Tk_Window          _t_k_w_i_n        (in)      Window for which _p_r_o_c will
  21.                                                provide selection information.
  22.  
  23.      Atom               _s_e_l_e_c_t_i_o_n    (in)      The name of the selection for  |
  24.                                                which _p_r_o_c will provide        |
  25.                                                selection information.
  26.  
  27.      Atom               _t_a_r_g_e_t       (in)      Form in which _p_r_o_c can provide
  28.                                                the selection (e.g. STRING or
  29.                                                FILE_NAME).  Corresponds to
  30.                                                _t_y_p_e arguments in sssseeeelllleeeeccccttttiiiioooonnnn
  31.                                                commands.
  32.  
  33.      Tk_SelectionProc   *_p_r_o_c        (in)      Procedure to invoke whenever
  34.                                                the selection is owned by _t_k_w_i_n
  35.                                                and the selection contents are
  36.                                                requested in the format given
  37.                                                by _t_a_r_g_e_t.
  38.  
  39.      ClientData         _c_l_i_e_n_t_D_a_t_a   (in)      Arbitrary one-word value to
  40.                                                pass to _p_r_o_c.
  41.  
  42.      Atom               _f_o_r_m_a_t       (in)      If the selection requestor
  43.                                                isn't in this process, _f_o_r_m_a_t
  44.                                                determines the representation
  45.                                                used to transmit the selection
  46.                                                to its requestor.
  47.  
  48.  
  49. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  50.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr arranges for a particular procedure (_p_r_o_c) to be     |
  51.      called whenever _s_e_l_e_c_t_i_o_n is owned by _t_k_w_i_n and the selection contents   |
  52.      are requested in the form given by _t_a_r_g_e_t. _T_a_r_g_e_t should be one of the
  53.      entries defined in the left column of Table 2 of the X Inter-Client
  54.      Communication Conventions Manual (ICCCM) or any other form in which an
  55.      application is willing to present the selection.  The most common form is
  56.      STRING.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))                              TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.      _P_r_o_c should have arguments and result that match the type
  75.      TTTTkkkk____SSSSeeeelllleeeeccccttttiiiioooonnnnPPPPrrrroooocccc:
  76.           typedef int Tk_SelectionProc(
  77.                ClientData _c_l_i_e_n_t_D_a_t_a,
  78.                int _o_f_f_s_e_t,
  79.                char *_b_u_f_f_e_r,
  80.                int _m_a_x_B_y_t_e_s);
  81.      The _c_l_i_e_n_t_D_a_t_a parameter to _p_r_o_c is a copy of the _c_l_i_e_n_t_D_a_t_a argument
  82.      given to TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr.  Typically, _c_l_i_e_n_t_D_a_t_a points to a data
  83.      structure containing application-specific information that is needed to
  84.      retrieve the selection.  _O_f_f_s_e_t specifies an offset position into the
  85.      selection, _b_u_f_f_e_r specifies a location at which to copy information about
  86.      the selection, and _m_a_x_B_y_t_e_s specifies the amount of space available at
  87.      _b_u_f_f_e_r.  _P_r_o_c should place a NULL-terminated string at _b_u_f_f_e_r containing
  88.      _m_a_x_B_y_t_e_s or fewer characters (not including the terminating NULL), and it
  89.      should return a count of the number of non-NULL characters stored at
  90.      _b_u_f_f_e_r.  If the selection no longer exists (e.g. it once existed but the
  91.      user deleted the range of characters containing it), then _p_r_o_c should
  92.      return -1.
  93.  
  94.      When transferring large selections, Tk will break them up into smaller
  95.      pieces (typically a few thousand bytes each) for more efficient
  96.      transmission.  It will do this by calling _p_r_o_c one or more times, using
  97.      successively higher values of _o_f_f_s_e_t to retrieve successive portions of
  98.      the selection.  If _p_r_o_c returns a count less than _m_a_x_B_y_t_e_s it means that
  99.      the entire remainder of the selection has been returned.  If _p_r_o_c's
  100.      return value is _m_a_x_B_y_t_e_s it means there may be additional information in
  101.      the selection, so Tk must make another call to _p_r_o_c to retrieve the next
  102.      portion.
  103.  
  104.      _P_r_o_c always returns selection information in the form of a character
  105.      string.  However, the ICCCM allows for information to be transmitted from
  106.      the selection owner to the selection requestor in any of several formats,
  107.      such as a string, an array of atoms, an array of integers, etc.  The
  108.      _f_o_r_m_a_t argument to TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr indicates what format should be
  109.      used to transmit the selection to its requestor (see the middle column of
  110.      Table 2 of the ICCCM for examples).  If _f_o_r_m_a_t is not STRING, then Tk
  111.      will take the value returned by _p_r_o_c and divided it into fields separated
  112.      by white space.  If _f_o_r_m_a_t is ATOM, then Tk will return the selection as
  113.      an array of atoms, with each field in _p_r_o_c's result treated as the name
  114.      of one atom.  For any other value of _f_o_r_m_a_t, Tk will return the selection
  115.      as an array of 32-bit values where each field of _p_r_o_c's result is treated
  116.      as a number and translated to a 32-bit value.  In any event, the _f_o_r_m_a_t
  117.      atom is returned to the selection requestor along with the contents of
  118.      the selection.
  119.  
  120.      If TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr is called when there already exists a handler for |
  121.      _s_e_l_e_c_t_i_o_n and _t_a_r_g_e_t on _t_k_w_i_n, then the existing handler is replaced with|
  122.      a new one.                                                               |
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))                              TTTTkkkk____CCCCrrrreeeeaaaatttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.      TTTTkkkk____DDDDeeeelllleeeetttteeeeSSSSeeeellllHHHHaaaannnnddddlllleeeerrrr removes the handler given by _t_k_w_i_n, _s_e_l_e_c_t_i_o_n, and   |
  141.      _t_a_r_g_e_t, if such a handler exists.  If there is no such handler then it
  142.      has no effect.
  143.  
  144.  
  145. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  146.      format, handler, selection, target
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.